/*
 * InvoiceJson.java
 * This file contains Boeing intellectual property. It
 * may contain information about Boeing processes that are part of the Company's
 * competitive advantage. Release of this file requires prior approval from
 * Luxoft Management. Copyright (c) 2008, The Boeing Company All Rights Reserved
 */
 

package cmd;

import data.Invoice;
import java.util.HashMap;
import java.util.Map;
import json.AbstractJsonObject;

/**
 *
 * @author dakhoa
 * @version 1.0
 */
public class InvoiceJson extends AbstractJsonObject {

    private Invoice invoice;

    public InvoiceJson(Invoice invoice) {
        this.invoice = invoice;
    }

    @Override
    protected Map<String, Object> serializeFields() {
        Map<String, Object> f = new HashMap<String, Object>();

        f.put("id", invoice.getId());
        f.put("invdate", invoice.getInvdate());
        f.put("name", invoice.getName());
        f.put("tax", invoice.getTax());
        f.put("total", invoice.getTotal());
        f.put("note", invoice.getNote());

        return f;
    }

}
